home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Pict Tricks / Batch CLUTLess / AppInterface.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-02  |  2.3 KB  |  87 lines  |  [TEXT/MMCC]

  1. #include <AppleEvents.h>
  2.  
  3. /* Menu IDs and item numbers */
  4. #define kAppleMenuID        128
  5.     #define    iAbout            1
  6.  
  7. #define kFileMenuID            129
  8.     #define    iNew            1
  9.     #define    iOpen            2
  10.     #define    iClose            3
  11.     #define    iSave            4
  12.     #define    iSaveAs            5
  13.     #define    iPageSetup        7
  14.     #define    iPrint            8
  15.     #define    iQuit            10
  16.  
  17. #define kEditMenuID            130
  18.     #define    iUndo            1
  19.     #define    iCut            3
  20.     #define    iCopy            4
  21.     #define    iPaste            5
  22.     #define    iClear            6
  23.  
  24. /* Indexes into global menu array */
  25. #define kAppleMenu            0
  26. #define kFileMenu            1
  27. #define kEditMenu            2
  28.  
  29. /* Protoypes for routines that app must provide */
  30.  
  31. /* Allow app a crack at raw event */
  32. Boolean AppDoEvent(EventRecord *Event);
  33.  
  34. /* The start and the end */
  35. Boolean    AppInit(void);
  36. Boolean    AppQuit(void);
  37. void     AppCleanUp(void);
  38.  
  39. /* Events */
  40. void     AppActivate(WindowPtr wind, Boolean activate);
  41. void     AppUpdate(EventRecord *event);
  42. void     AppIdle(EventRecord *event);
  43. void     AppClick(Point thePt, WindowPtr whichWindptr, Boolean doubleClick);
  44. void     AppGrowWindow(WindowPtr wind, Point where, Rect *desk);
  45. void     AppZoomWindow(WindowPtr wind, short zoomDir);
  46.  
  47. /* Apple Event handlers */
  48. pascal OSErr AppOAPPHandler(AppleEvent *theAEvent, AppleEvent *reply, long refcon);
  49. pascal OSErr AppODOCHandler(AppleEvent *theAEvent, AppleEvent *reply, long refcon);
  50. pascal OSErr AppPDOCHandler(AppleEvent *theAEvent, AppleEvent *reply, long refcon);
  51. pascal OSErr AppQUITHandler(AppleEvent *theAEvent, AppleEvent *reply, long refcon);
  52.     
  53. /* Menus in general */
  54. void    AppAdjustMenus(void);
  55. void     AppMenu(short id, short item);
  56.  
  57. /* File Menu */
  58. void    AppNew(void);
  59. void    AppOpen(void);
  60. Boolean    AppClose(void);
  61. Boolean    AppSave(void);
  62. Boolean    AppSaveAs(void);
  63. void    AppPageSetup(void);
  64. void    AppPrint(void);
  65.  
  66. /* Edit Menu */
  67. void     AppUndo(void);
  68. void     AppCut(void);
  69. OSErr     AppCopy(void);
  70. void     AppPaste(void);
  71. void     AppClear(void);
  72.  
  73.  
  74. /* utils.c, part of the shell, but we may need 'em */
  75. int            abs(int i);
  76. long        labs(long i);
  77. Boolean     NewPixImage(PixMapHandle ThePix, Rect *TheRect, short dpth);
  78. Boolean     NewBitMap(BitMap *TheMap, Rect *TheRect);
  79. void         CenterRect(Rect *theRect, Point *thePt);
  80. Point         Center(Rect *theRect);
  81. short        NumToolboxTraps(void);
  82. TrapType    GetTrapType(short theTrap);
  83. Boolean        TrapAvailable(short theTrap);
  84. void        pcat255(StringPtr d, StringPtr s);
  85. void        pcat63(StringPtr d, StringPtr s);
  86. void        AppendStr31(StringPtr d, StringPtr s);
  87.